﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BO;

namespace Site_CamaraTibau
{
    public partial class LOA : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    onload();
                }
            }
            catch (Exception)
            {

                throw;
            }
        }


        #region Contexto
        ModeloContainer bco = new ModeloContainer();
        #endregion

        public void onload()
        {
            try
            {

                var objs = (from a in bco.Leis
                            where a.idTipoLei == 7
                            orderby a.dtPublicacao
                            descending
                            select new
                            {
                                ID = a.id,
                                DtPublicacao = a.dtPublicacao,
                                Numero = a.Numero,
                                url = "~/Regimento/" + a.URL
                            }).ToList();

                rptLeisOrganicas.DataSource = objs;
                rptLeisOrganicas.DataBind();


                var objs2 = (from a in bco.Leis
                            where a.idTipoLei == 4
                            orderby a.dtPublicacao
                            descending
                            select new
                            {
                                ID = a.id,
                                DtPublicacao = a.dtPublicacao,
                                Numero = a.Numero,
                                url = "~/Regimento/" + a.URL
                            }).ToList();

                rptLeisEmentas.DataSource = objs2;
                rptLeisEmentas.DataBind();

            }

            catch (Exception)
            {
                throw;
            }

        }
    }
}